<HTML><HEAD><TITLE>pathname(+FilePath, -Path, -Name)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Operating System</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>pathname(+FilePath, -Path, -Name)</H1>
If FilePath is a pathname of a file, succeed if Path is the pathname of its
parent directory and Name is the local file name.


<DL>
<DT><EM>FilePath</EM></DT>
<DD>String or atom.
</DD>
<DT><EM>Path</EM></DT>
<DD>Variable or string.
</DD>
<DT><EM>Name</EM></DT>
<DD>Variable or string.
</DD>
</DL>
<H2>Description</H2>
   This predicate is used to decompose FilePath which is either a relative
   or absolute pathname of a file, into two components, namely the pathname
   of its parent directory including the trailing "/" if any, and the plain
   name of the file Name.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>pathname(+, -, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>FilePath is not instantiated.
<DT><EM>(5) type error </EM>
<DD>FilePath is neither a string nor an atom.
<DT><EM>(5) type error </EM>
<DD>Path is neither a string nor a variable.
<DT><EM>(5) type error </EM>
<DD>Name is neither a string nor a variable.
</DL>
<H2>Examples</H2>
<PRE>
Success:
      [eclipse]: pathname("/home/user/userfile", P, F).
      P = "/home/user/"
      F = "userfile"
      yes.

      pathname("/home/user","/home/").
      pathname("/home/","/home/","").
      pathname("home","","home").

Fail:
      pathname("/home/file","/home","file").

Error:
      pathname(F,P,R).                 (Error 4).
      pathname("/home/file",P,file)    (Error 5).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/opsys/pathname-4.html">pathname / 4</A>
</BODY></HTML>
